HA$PBExportHeader$u_cst_tablistadomain.sru
forward
global type u_cst_tablistadomain from u_cst_tabpage
end type
type ddlb_main from dropdownlistbox within u_cst_tablistadomain
end type
type uo_toolbarstrip from u_cst_toolbarstrip within u_cst_tablistadomain
end type
type uo_tabcontrol from u_cst_tabcontrol within u_cst_tablistadomain
end type
type rb_6 from radiobutton within u_cst_tablistadomain
end type
type cbx_2 from checkbox within u_cst_tablistadomain
end type
type cbx_1 from checkbox within u_cst_tablistadomain
end type
type rb_5 from radiobutton within u_cst_tablistadomain
end type
type rb_4 from radiobutton within u_cst_tablistadomain
end type
type rb_3 from radiobutton within u_cst_tablistadomain
end type
type rb_2 from radiobutton within u_cst_tablistadomain
end type
type rb_1 from radiobutton within u_cst_tablistadomain
end type
type gb_1 from groupbox within u_cst_tablistadomain
end type
type gb_2 from groupbox within u_cst_tablistadomain
end type
end forward

global type u_cst_tablistadomain from u_cst_tabpage
integer width = 3067
integer height = 2264
event ue_tab ( string tab,  powerobject param,  string as_titulo,  long ll_codreport,  ref long ll_index,  ref userobject piuo_user )
event type integer ue_validar ( )
ddlb_main ddlb_main
uo_toolbarstrip uo_toolbarstrip
uo_tabcontrol uo_tabcontrol
rb_6 rb_6
cbx_2 cbx_2
cbx_1 cbx_1
rb_5 rb_5
rb_4 rb_4
rb_3 rb_3
rb_2 rb_2
rb_1 rb_1
gb_1 gb_1
gb_2 gb_2
end type
global u_cst_tablistadomain u_cst_tablistadomain

type variables
string is_tituloSecu,is_rutaIcoSecu,isTabSecu,is_tiptab  ,is_columna,isa_columna[],is_idToolBar,is_idmenu,is_tab2,is_grilla,is_entidad
//u_cst_DW uo_dw_1
//u_cst_dwcabedeta uo_dw_11
Boolean ib_preview
long il_open,il_menu,il_index,il_report [] 
Window iw_parent
//s_main_param istruc_param
//s_param_report  istruc_param_report
userobject iuo_user[ ]
u_cst_powerdock iou_powerdock
int ii_tabindex , ii_tabindex2
userobject iuo_userObject[]
long ii_idmenu
s_parm istr_parm
u_cst_grillamain iuo_grillamain
datastore ids_datastore ,ids_sysmenutool,ids_store
end variables

forward prototypes
public subroutine of_settheme (string as_color)
public function integer of_getwindow ()
end prototypes

event ue_tab(string tab, powerobject param, string as_titulo, long ll_codreport, ref long ll_index, ref userobject piuo_user);long ll_image

ii_tabindex2 = uo_tabcontrol.of_gettabcount( ) + 1 
il_report [ii_tabindex2] = ll_codreport

uo_tabcontrol.of_opentab( iuo_user[ii_tabindex2 ], param,as_titulo, 'Menu5!',tab)
//uo_tabcontrol.of_displayclosebuttonintab( true)
//uo_tabcontrol.of_showclosebutton( )
//iuo_parent.of_opentab( iuo_userObject[ii_tabindex ],istruc_param,'prueba_report','u_cst_dw_report',ll_image)

//uo_1.of_opentab( iuo_user[ii_tabindex2 ] ,param,as_titulo,tab,ll_image)
//uo_tabcontrol.of_opentab( iuo_user[ii_tabindex2 ] ,param,as_titulo,tab,ll_image)

//ll_image = uo_1.of_AddImage(is_rutaIcoSecu)//C:\PBGUIControls105\globe.ico

//uo_tabcontrol.of_opentab( iuo_user[ii_tabindex2 ] ,param,as_titulo,tab,ll_image)

//uo_1.of_OpenTab(uo_mle_1, 'THIS IS A REALLY LONG TEXT HEADER IN ALL CAPS',1)
//uo_1.of_OpenTab(uo_mle_1, 'This is a really long text Header in all caps',1)
//uo_1.of_OpenTab(uo_mle_2, 'Tab Two',2)
//uo_1.of_OpenTab(uo_mle_3, 'Tab Three',3)
uo_tabcontrol.of_SelectTab(ii_tabindex2)
uo_tabcontrol.of_SetStyle(uo_tabcontrol.REGULAR)

piuo_user =  iuo_user[ii_tabindex2 ] 
ll_index =ii_tabindex2
end event

event type integer ue_validar();return 0
end event

public subroutine of_settheme (string as_color);uo_tabcontrol.of_SetTheme(as_color)
end subroutine

public function integer of_getwindow (); PowerObject	lpo_parent
Window lw_window

// loop thru parents until a window is found
lpo_parent = GetParent()
Do While lpo_parent.TypeOf() <> Window! and IsValid(lpo_parent)
	lpo_parent = lpo_parent.GetParent()
Loop

// set return to the window or null if not found
If IsValid (lpo_parent) Then
	lw_window = lpo_parent
Else
	SetNull(lw_window)
End If

iw_parent = lw_window

RETURN 1
end function

on u_cst_tablistadomain.create
int iCurrent
call super::create
this.ddlb_main=create ddlb_main
this.uo_toolbarstrip=create uo_toolbarstrip
this.uo_tabcontrol=create uo_tabcontrol
this.rb_6=create rb_6
this.cbx_2=create cbx_2
this.cbx_1=create cbx_1
this.rb_5=create rb_5
this.rb_4=create rb_4
this.rb_3=create rb_3
this.rb_2=create rb_2
this.rb_1=create rb_1
this.gb_1=create gb_1
this.gb_2=create gb_2
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.ddlb_main
this.Control[iCurrent+2]=this.uo_toolbarstrip
this.Control[iCurrent+3]=this.uo_tabcontrol
this.Control[iCurrent+4]=this.rb_6
this.Control[iCurrent+5]=this.cbx_2
this.Control[iCurrent+6]=this.cbx_1
this.Control[iCurrent+7]=this.rb_5
this.Control[iCurrent+8]=this.rb_4
this.Control[iCurrent+9]=this.rb_3
this.Control[iCurrent+10]=this.rb_2
this.Control[iCurrent+11]=this.rb_1
this.Control[iCurrent+12]=this.gb_1
this.Control[iCurrent+13]=this.gb_2
end on

on u_cst_tablistadomain.destroy
call super::destroy
destroy(this.ddlb_main)
destroy(this.uo_toolbarstrip)
destroy(this.uo_tabcontrol)
destroy(this.rb_6)
destroy(this.cbx_2)
destroy(this.cbx_1)
destroy(this.rb_5)
destroy(this.rb_4)
destroy(this.rb_3)
destroy(this.rb_2)
destroy(this.rb_1)
destroy(this.gb_1)
destroy(this.gb_2)
end on

event selectionchanged;call super::selectionchanged;w_main.SetMicroHelp("Selection Changed - " + &
		"oldindex: " + String(oldindex) + &
		" newindex: " + String(newindex))

end event

event ue_postconstructor;call super::ue_postconstructor;long ll_image

ii_tabindex ++

istr_parm.auo_tabcontrol  = uo_tabcontrol
istr_parm.auo_powerdock = iou_powerdock
istr_parm.auo_grillamain = iuo_grillamain
istr_parm.auo_userobject = this

//indice de primer report por default
istr_parm.ai_report =0
il_report [ii_tabindex] = 1
uo_tabcontrol.of_opentab( iuo_user[ii_tabindex ], istr_parm, 'Listado de ' + is_entidad, 'Menu5!',is_tab2)
uo_tabcontrol.of_SelectTab(ii_tabindex)
//uo_tabcontrol.of_hidearrows( )
//uo_tabcontrol.of_hidechevron( )
uo_tabcontrol.of_hideclosebutton( )


//iou_powerdock.of_OpenDocument( iuo_user[ii_tabindex ], istr_parm,is_tituloSecu,is_rutaIcoSecu,isTabSecu)
//iou_powerdock.of_ActivateDocument(iuo_user[ii_tabindex])
//long ll_image
//uo_1.of_AddImage('SQL!')
//uo_1.of_AddImage('StaticText!')
//uo_1.of_AddImage('Tab!')
//
//uo_1.of_OpenTab(uo_mle_1, 'Tab One',1)
//uo_1.of_OpenTab(uo_dw_1, 'Tab One',1)

//uo_1.of_opentab( uo_dw_11, istruc_param, 'Tab One', 1)

//if is_tipTab ='R' then 
//	uo_toolbar.event 	ue_buttonclicked( 'PARAMETROS' )
//	return
//end if
////ii_tabindex2 ++
//if uo_1.of_gettabcount( )  = 0   then 
//	ii_tabindex2 = 0
//
//end if
//ii_tabindex2 = uo_1.of_gettabcount( ) + 1 
////il_report [ii_tabindex2] = ll_codreport
////istruc_param.as_dwreport = 'd_report_user2'
//
//
////iuo_parent.of_opentab( iuo_userObject[ii_tabindex ],istruc_param,'prueba_report','u_cst_dw_report',ll_image)
//is_tituloSecu = is_tituloSecu + string(ii_tabindex2)
//
//ll_image = uo_1.of_AddImage(is_rutaIcoSecu)//C:\PBGUIControls105\globe.ico

//uo_1.of_opentab(iuo_user[ii_tabindex2 ],istruc_param,is_tituloSecu  ,isTabSecu,ll_image)
//il_report [ii_tabindex2] = 1

//uo_1.of_OpenTab(uo_mle_1, 'THIS IS A REALLY LONG TEXT HEADER IN ALL CAPS',1)
//uo_1.of_OpenTab(uo_mle_1, 'This is a really long text Header in all caps',1)
//uo_1.of_OpenTab(uo_mle_2, 'Tab Two',2)
//uo_1.of_OpenTab(uo_mle_3, 'Tab Three',3)
//uo_1.of_SelectTab(ii_tabindex2)
//uo_1.of_SetStyle(uo_1.REGULAR)
//

end event

event resize;call super::resize;uo_toolbarstrip.Width = newWidth - 50 //this.Width - 20
//uo_1.Width = this.Width //- 20
uo_tabcontrol.Resize(newWidth - 50,newHeight)


//of_resize(newWidth,newHeight)
end event

event constructor;call super::constructor;istr_parm = message.powerobjectparm 

iou_powerdock = istr_parm.auo_powerdock 
iuo_grillamain = istr_parm.auo_grillamain

ids_datastore  =  istr_parm.ads_menu  //aqui recibe el datastore del menu seleccionado
is_idmenu       =  ids_datastore.object.Idmenu[1]
is_idToolBar    =  ids_datastore.object.idToolBar[1]
is_tab2   		   =   ids_datastore.object.tTab2[1]
is_grilla 		   =   ids_datastore.object.tDwGrid[1]
is_entidad      =    ids_datastore.object.tEntidad[1]
if isnull(is_entidad) then is_entidad =''
of_getwindow()


end event

type ddlb_main from dropdownlistbox within u_cst_tablistadomain
boolean visible = false
integer x = 1326
integer y = 12
integer width = 649
integer height = 328
integer taborder = 20
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type

type uo_toolbarstrip from u_cst_toolbarstrip within u_cst_tablistadomain
event type integer ue_validar ( )
integer width = 2789
integer taborder = 20
end type

event type integer ue_validar();RETURN 0
end event

event constructor;call super::constructor;string ls_dtool,ls_rutaicono,ls_tiptext,ls_tipobject
integer li_fila,li_visible,li_enabled

ids_sysmenutool = Create DataStore
ids_sysmenutool.DataObject = "d_macceso_menu_button"
ids_sysmenutool.settransobject( sqlca)
ids_sysmenutool.retrieve( is_idToolBar,gs_iduser,is_idmenu)

if ids_sysmenutool.rowcount() > 0 then
	for li_fila = 1 to  ids_sysmenutool.rowcount() 
		ls_tipobject=	 ids_sysmenutool.object.tTipo [li_fila]
		ls_dtool = ids_sysmenutool.object.tDesc[li_fila]
		li_visible  = ids_sysmenutool.object.bvisibleButton[li_fila]
		li_enabled  = ids_sysmenutool.object.benabledButton[li_fila]
		ls_rutaicono =''
		ls_rutaicono=  ids_sysmenutool.object.timg[li_fila]
		if left(trim(ls_rutaicono),1)='\' then ls_rutaicono=  gs_unidad+ids_sysmenutool.object.timg[li_fila]
		
		ls_tiptext = ids_sysmenutool.object.tTipText[li_fila]
		
		if li_visible =1 then
			if ls_tipobject = 'S' then //esto es si va a poner un separador
				  this.of_AddSeparator() ; continue
			end if
			if ls_tipobject = 'D' then 
				if li_enabled = 1 then
					ddlb_main.enabled=true
				else
					ddlb_main.enabled=false
				end if
				ddlb_main.visible = true
				this.of_AddObject(ls_dtool, ddlb_main) ;
				continue
			end if
			
//			if ls_tipobject = 'T' then 
//					if li_enabled = 1 then
//						sle_buscar.visible=true
//						sle_buscar.enabled=true
//					else
//						sle_buscar.visible=false
//						sle_buscar.enabled=false
//					end if
//				sle_buscar.enabled=true
//				this.of_AddObject(ls_dtool, sle_buscar) 
//				continue
//			end if
						
			if ls_tiptext = '' or isnull(ls_tiptext) then ls_tiptext = ls_dtool
			this.of_AddItem(ls_dtool,ls_rutaicono, ls_tiptext)
			if li_enabled=1 then
				this.of_SetEnabled(ls_dtool,true)
			else
				this.of_SetEnabled(ls_dtool,false)
			end if
		end if
	next
end if

//shl_1.visible=true
//shl_1.enabled=true
//this.of_AddObject('Ayuda', shl_1)
//THIS.of_SetSize(THIS.S)
this.of_DisplayText(true)







end event

on uo_toolbarstrip.destroy
call u_cst_toolbarstrip::destroy
end on

event ue_buttonclicked;call super::ue_buttonclicked;String ls_file,ls_titulo,ls_userobject,ls_rutaMain
long ll_data,ll_count,ll_index,ll_item,ll_report
il_index  =  uo_tabcontrol.of_getselectedtab( )

CHOOSE CASE Upper(as_button)
	CASE 'ACTUALIZAR'
		iuo_user[il_index].triggerevent( 'ue_refrescar')
	case 'AGRUPAR'//CTA CTE
		iuo_user[il_index ].EVENT DYNAMIC ue_agrupar()  
	case 'APROBAR'
		iuo_user[il_index ].EVENT DYNAMIC ue_aprobar()  
	case 'VER DOCUMENTO'
		iuo_user[il_index ].EVENT DYNAMIC ue_viewdocu()  
	case 'ANULAR'
		iuo_user[il_index ].EVENT DYNAMIC ue_anular()
	case 'BUSCAR'	
		iuo_user[il_index ].DYNAMIC of_Find()
	case 'CONFORMIDAD'
		iuo_user[il_index ].EVENT DYNAMIC ue_conforme() 
	case 'DESHACER'
		iuo_user[il_index ].EVENT DYNAMIC ue_deshacer()
	case 'FINALIZAR'
		iuo_user[il_index ].EVENT DYNAMIC ue_finalizar()
	case 'MOVER'
		iuo_user[il_index ].EVENT DYNAMIC ue_mover()
	case'NO CONFORME'
		iuo_user[il_index ].EVENT DYNAMIC ue_noconforme()  
	case 'GENERAR'	
		if il_index >  0 then ll_report  =   il_report [il_index]
		iuo_user[il_index ].EVENT DYNAMIC ue_generar(ll_report)
	case 'GENERAR LETRAS'//cta cte
		iuo_user[il_index ].EVENT DYNAMIC ue_letras()  
	case 'ORDENAR'
		iuo_user[il_index ].triggerevent( 'ue_ordenar' )
	case 'PARAMETROS'
		iuo_user[il_index ].EVENT DYNAMIC ue_parametros() 
	case 'PREVIEW'
		ib_preview = NOT ib_preview
		IF ib_preview THEN
			iuo_user[il_index ].DYNAMIC of_preview(1)
		ELSE
		     iuo_user[il_index ].DYNAMIC of_preview(2 )
		END IF
  	case 'REPORTES'
		iuo_user[il_index ].EVENT DYNAMIC ue_reportes()
	case 'REENVIAR'
		iuo_user[il_index ].EVENT DYNAMIC ue_reenviar()
	case 'VER PAGOS'//cta cte
		iuo_user[il_index ].EVENT DYNAMIC ue_verpagos()  
	
	case 'IMPRIMIR'
		  iuo_user[il_index ].DYNAMIC of_imprimir( )
	case 'SIGUIENTE'
		iuo_user[il_index ].triggerevent( 'ue_siguiente' )
	case 'ANTERIOR'
		iuo_user[il_index ].triggerevent( 'ue_anterior' )		
	case 'PRIMERO'
		iuo_user[il_index ].triggerevent( 'ue_primero' )
	case 'ULTIMO'
		iuo_user[il_index ].triggerevent( 'ue_ultimo' )	
	case 'ZOOM --'
		iuo_user[il_index ].triggerevent( 'ue_zoommenos' )

	case 'ZOOM ++'
		iuo_user[il_index ].triggerevent( 'ue_zoommas')

	CASE 'NUEVO'
		ii_tabindex++
		ls_titulo = 'NUEVA '// + ids_datastore.object.cdesc[1]
		iou_powerdock.of_opendocument( iuo_userObject[ii_tabindex],istr_parm,ls_titulo ,'',is_tab2)
		iou_powerdock.of_ActivateDocument(iuo_userObject[ii_tabindex])
END CHOOSE
end event

type uo_tabcontrol from u_cst_tabcontrol within u_cst_tablistadomain
integer y = 108
integer width = 2789
integer height = 2156
integer taborder = 20
end type

on uo_tabcontrol.destroy
call u_cst_tabcontrol::destroy
end on

event tabclosing;return 1
end event

event tabclosed;call super::tabclosed;//userobject  luo_user[]
//long al_index,ll_count,ll_index,ll_item,ll_report[]
//
//
//al_index  =index
//ll_count = UpperBound(iuo_user)
////f_msj( '','coutn' + string(ll_count ),4 )
//
//FOR ll_index = 1 TO ll_count
//	IF ll_index <> al_index THEN
//		ll_item++
//		luo_user [ll_item] = iuo_user[ll_index]
//		ll_report[ll_item] = il_report [ll_index]
//	END IF
//NEXT
//
//iuo_user = luo_user
//il_report = ll_report
//
//if index  = 1 then return
//iw_parent.CloseUserObject(iuo_user[index])
//CloseUserObject(iuo_user[index ] )
end event

type rb_6 from radiobutton within u_cst_tablistadomain
integer x = 754
integer y = 2036
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Office 2007"
end type

event clicked;uo_tabcontrol.of_SetStyle(uo_tabcontrol.OFFICE2007)
end event

type cbx_2 from checkbox within u_cst_tablistadomain
integer x = 1243
integer y = 1816
integer width = 434
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Show Arrows"
boolean checked = true
end type

event clicked;IF THIS.Checked THEN
	uo_tabcontrol.of_ShowArrows()
ELSE
	uo_tabcontrol.of_HideArrows()
END IF
end event

type cbx_1 from checkbox within u_cst_tablistadomain
integer x = 1243
integer y = 1732
integer width = 571
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Show Close Button"
boolean checked = true
end type

event clicked;IF THIS.Checked THEN
	uo_tabcontrol.of_ShowCloseButton()
ELSE
	uo_tabcontrol.of_HideCloseButton()
END IF
end event

type rb_5 from radiobutton within u_cst_tablistadomain
integer x = 754
integer y = 1960
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "VS2005"
boolean checked = true
end type

event clicked;uo_tabcontrol.of_SetStyle(uo_tabcontrol.VS2005)
end event

type rb_4 from radiobutton within u_cst_tablistadomain
integer x = 754
integer y = 1884
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Excel"
end type

event clicked;uo_tabcontrol.of_SetStyle(uo_tabcontrol.EXCEL)
end event

type rb_3 from radiobutton within u_cst_tablistadomain
integer x = 759
integer y = 1808
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Regular"
end type

event clicked;uo_tabcontrol.of_SetStyle(uo_tabcontrol.REGULAR)
end event

type rb_2 from radiobutton within u_cst_tablistadomain
integer x = 155
integer y = 1884
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Bottom"
end type

event clicked;uo_tabcontrol.of_SetTabPosition(uo_tabcontrol.BOTTOM)
end event

type rb_1 from radiobutton within u_cst_tablistadomain
integer x = 155
integer y = 1808
integer width = 402
integer height = 80
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Top"
boolean checked = true
end type

event clicked;uo_tabcontrol.of_SetTabPosition(uo_tabcontrol.TOP)
end event

type gb_1 from groupbox within u_cst_tablistadomain
integer x = 96
integer y = 1732
integer width = 485
integer height = 284
integer taborder = 10
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Position"
end type

type gb_2 from groupbox within u_cst_tablistadomain
integer x = 690
integer y = 1732
integer width = 507
integer height = 416
integer taborder = 10
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Style"
end type

